<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>房联行增值服务部后台管理中心</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
		<link rel="stylesheet" href="./css/font.css">
		<link rel="stylesheet" href="./css/xadmin.css">
		<script type="text/javascript" src="js/jquery.min.js"></script>
		<script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="./js/xadmin.js"></script>
		<!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
		<!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
	</head>
	<body>
		<div class="x-body">
			<div class="x-nav">
		      	<span class="layui-breadcrumb">
			        <a href="javascript:;">首页</a>
			        <a href="javascript:;">新增装修公司</a>
			        <a>
			          <cite>新增案例</cite>
			        </a>
		      	</span>
			    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
			        <i class="layui-icon layui-icon-refresh-1" style="line-height:30px"></i>
			    </a>
    		</div>
			<form class="layui-form layui-form-pane">
				<div style="padding:40px 15%;">
					<div class="layui-row layui-col-space15">
						<div class="layui-col-md6">	
							<div class="layui-form-item">
								<label class="layui-form-label">标题：</label>
								<div class="layui-input-inline w240">
									<input type="text" id="title" name="title" required="" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">施工小区：</label>
								<div class="layui-input-inline w240">
									<input type="text" id="title" name="title" required="" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">房屋所在地：</label>
								<div class="layui-input-inline w240">
									<input type="text" id="title" name="title" required="" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item mt20">
								<label  class="layui-form-label">装修公司：</label>
								<div class="layui-input-inline w240">
									<select name="ad-space" required="" lay-verify="required" >
										<option value="" selected="">请选择</option>
										<option value="获取数据" >获取数据</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item mt20">
								<label class="layui-form-label">设计师：</label>
								<div class="layui-input-inline w240">
									<select name="ad-space" required="" lay-verify="required" >
										<option value=""  selected="">请选择</option>
										<option value="设计师一">设计师一</option>
										<option value="设计师二">设计师二</option>
										<option value="设计师三">设计师三</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item mt20">
								<label  class="layui-form-label">施工团队：</label>
								<div class="layui-input-inline w240">
									<select name="ad-space" required="" lay-verify="required" >
										<option value=""  selected="">请选择</option>
										<option value="团队一">团队一</option>
										<option value="团队二">团队二</option>
										<option value="团队三">团队三</option>
									</select>
								</div>
							</div>
						</div>
						<div class="layui-col-md6">
							<div class="layui-form-item">
								<label class="layui-form-label">装修费用：</label>
								<div class="layui-input-inline w240">
									<input type="text" id="price" name="price" required="" lay-verify="required" placeholder="例：2000元/平米" autocomplete="off" class="layui-input">
								</div>
							</div>
							<div class="layui-form-item mt20">
								<label class="layui-form-label">装修风格：</label>
								<div class="layui-input-inline w240">
									<select name="ad-space" required="" lay-verify="required" >
										<option value=""  selected="">请选择</option>
										<option value="混搭">混搭</option>
										<option value="欧式/简欧">欧式/简欧</option>
										<option value="中式">中式</option>
										<option value="新古典">新古典</option>
										<option value="东南亚">东南亚</option>
										<option value="美式">美式</option>
										<option value="北欧">北欧</option>
										<option value="地中海">地中海</option>
										<option value="现代/简约">现代/简约</option>
										<option value="日式">日式</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item">
								<label class="layui-form-label">使用面积：</label>
								<div class="layui-input-inline w180 mr0">
									<input type="text" id="area" name="area" placeholder="例：***/平米" required="" lay-verify="required" autocomplete="off" class="layui-input">
								</div>
								<label class="layui-form-label w60" style=" margin-left: -1px;">平米</label>
							</div>
							<div class="layui-form-item mt20">
								<label class="layui-form-label">装修方式：</label>
								<div class="layui-input-inline w240">
									<select name="ad-space" required="" lay-verify="required" >
										<option value=""  selected="">请选择</option>
										<option value="清包" >清包</option>
										<option value="半包">半包</option>
										<option value="全包">全包</option>
										<option value="套餐">套餐</option>
									</select>
								</div>
							</div>
							<div class="layui-form-item mt20">
								<label class="layui-form-label">装修居室：</label>
								<div class="layui-input-inline w240">
									<select name="ad-space" required="" lay-verify="required" >
										<option value=""  selected="">请选择</option>
										<option value="方式一">小公寓</option>
										<option value="方式二">平层</option>
										<option value="方式三">复式</option>
										<option value="方式三">大宅</option>
										<option value="方式三">别墅</option>
										<option value="方式三">局部改造</option>
									</select>
								</div>
							</div>	
						</div>
						<div class="layui-col-md12">
							<div class="layui-form-item layui-form-text">
								<label class="layui-form-label">设计理念</label>
								<div class="layui-input-block">
									<textarea lay-verify="design-idea" name="design-idea" class="layui-textarea" style="min-height: 50px;"></textarea>
								</div>
							</div>
						</div>
						<div class="layui-col-md12">
							<div class="layui-form-item">
								<label class="layui-form-label layui-form-pane-no">案例详情：</label>
								<div class="layui-input-inline">
									<div class="layui-form-item">
										<img class="layui-upload-img" id="case_show" width="190" src="images/banner.png">
										<p id="demoText"></p>
									</div>
									<div class="layui-input-inline mb20">
										<select name="ad-space">
											<option value="" selected="">原始结构图</option>
											<option value="平面结构图">平面结构图</option>
											<option value="客厅">客厅</option>
											<option value="餐厅">餐厅</option>
											<option value="餐厅">卧室</option>
											<option value="餐厅">走廊</option>
											<option value="餐厅">玄关</option>
											<option value="餐厅">厨房</option>
											<option value="餐厅">卫生间</option>
											<option value="餐厅">阳台</option>
										</select>
									</div>
									<button type="button" class="layui-btn" id="case" style="width: 190px;"><i class="layui-icon"></i>选择上传文件</button>
									<div class="layui-input-inline w320" style=" padding: 20px 0px;color: #999;">只能上传jpg/png格式文件，文件不能超过XXkb</div>
								</div>
							</div>
						</div>
				
					</div>
				</div>
				<div class="layui-form-item" style="margin: 40px auto 40px auto; text-align: center;">
					<button class="layui-btn p40" lay-filter="add" lay-submit="" id="addfrom">提交</button>
					<button type="reset" class="layui-btn p40 layui-btn-primary">重置</button>
				</div>
			</form>
		</div>
		<script>
			layui.use(['form', 'layer', 'element', 'upload'], function() {
				var $ = layui.jquery
				var form = layui.form,
				layer = layui.layer,
				upload = layui.upload;	
				//普通图片上传
				var uploadInst = upload.render({
					elem: '#case',
					url: '/upload/'
					,before: function(obj) {
						//预读本地文件示例，不支持ie8
						obj.preview(function(index, file, result) {
							$('#case_show').attr('src', result); //图片链接（base64）
						});
					},
					done: function(res) {
						//如果上传失败
						if(res.code > 0) {
							return layer.msg('上传失败');
						}
						//上传成功
					},
					error: function() {
						//演示失败状态，并实现重传
						
					}
				});
			
				//监听提交
				form.on('submit(add)', function(data) {
					console.log(data);
					//发异步，把数据提交给php
					layer.alert("增加成功", {
						icon: 6
					}, function() {
						// 获得frame索引
						var index = parent.layer.getFrameIndex(window.name);
						//关闭当前frame
						parent.layer.close(index);
					});
					return false;
				});
			});
		</script>
	</body>
</html>